/*
 * Copyright (C) 2010 ExtPlus.org
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.extplus.base;

/**
 * 标准Ext AJAX请求响应消息体
 * @param <T> 返回数据类型
 */
public class Response<T> {
	/**
	 * AJAX请求处理结果，True成功，False失败
	 */
	private boolean success;

	/**
	 * AJAX请求响应消息
	 */
	private String message;

	/**
	 * 数据实体
	 */
	private T data;

	/**
	 * 获取业务处理结果
	 * @return 业务处理结果
	 */
	public boolean isSuccess() {
		return success;
	}

	/**
	 * 设置业务处理结果
	 * @param success 业务处理结果
	 */
	public void setSuccess(boolean success) {
		this.success = success;
	}

	/**
	 * 获取响应消息
	 * @return 响应消息
	 */
	public String getMessage() {
		return message;
	}

	/**
	 * 设置AJAX请求响应消息
	 * @param message 响应消息
	 */
	public void setMessage(String message) {
		this.message = message;
	}

	/**
	 * 获取响应数据
	 * @return 响应数据
	 */
	public T getData() {
		return data;
	}

	/**
	 * 设置响应数据
	 * @param data 响应数据
	 */
	public void setData(T data) {
		this.data = data;
	}

}
